package com.baizhi.util;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthenticatingRealm;

/**
 * @Author: renpu
 * @Date: 2019/3/14 16:24
 * @Description:
 */
public class SelfOptionRealm extends AuthenticatingRealm {
    @Override
    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
        String username=(String)token.getPrincipal();
        String pasword="123";

        SimpleAuthenticationInfo info = new SimpleAuthenticationInfo(username, pasword, this.getName());

        return info;
    }
}
